<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str ="aassdddff";
        var str1="";
        for(var i=0;i<=str.length;i++){
            if(str1.indexOf(str[i])==-1){
                str1+=str[i];
            }
        }
        console.log(str1);
    </script>
</body>
</html>